//
//  CommentConstants.swift
//  SSComment
//
//  Created by 松松 on 2019/4/25.
//

import Foundation
import Kingfisher
import UIKit

var userModel : CommentUserModel!

public class SSCommentUI{
    static public func setUserModel(_ model: CommentUserModel){
        userModel = model
    }
    static public func setAppCode(_ appCode:String){
        APP_CODE = appCode
    }
}

public typealias CommentLoginBlock = (UIViewController) -> Void

var commentLoginBlock : CommentLoginBlock?

let COMMENT_BG_COLOR = UIColor.init(red: 240/255, green: 239/255, blue: 245/255, alpha: 1)
let COMMENT_MAX_CONTENT : Int = 140


extension UIImageView{

    func loadUrl(url : String? , placeHolder:Image = UIImage() ) {

        if url == nil || url!.isEmpty{
            self.image = placeHolder
        }else{
            let urlStr = url!.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)

            self.kf.setImage(with: URL(string: urlStr!) , placeholder: placeHolder)
        }

    }
}
